{% load static %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>找回密码</title>
    <!-- 引入Vue.js -->

    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f2f2f2;
            padding: 20px;
        }

        h1 {
            text-align: center;
            color: #333;
            margin-bottom: 30px;
        }

        form {
            width: 300px;
            margin: 0 auto;
            background-color: #fff;
            border: 1px solid #ccc;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        label {
            display: block;
            color: #555;
            margin-bottom: 10px;
        }

        input[type="email"],
        input[type="password"],
        input[type="text"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
            margin-bottom: 15px;
        }

        button {
            display: block;
            width: 100%;
            background-color: #4CAF50;
            color: #fff;
            padding: 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .get-email {
            display: block;
            width: 100%;
            background-color: #4CAF50;
            color: #fff;
            padding: 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        .error_tip {
            float: left;
            height: 30px;
            line-height: 30px;
            margin-left: 87px;
            color: #e62e2e;
            display: none;
        }
        button:disabled {
            background-color: #aaa;
            cursor: not-allowed;
        }
    </style>

</head>
<body>
<div id="app">
    <h1>找回密码</h1>

    <form method="post">
        {% csrf_token %}

        <label for="email">邮箱：</label>
        <input name="email" type="email" id="email"  required>
        <span id="error_email" class="error_tip"> </span><br>
        <label for="newPassword">新密码：</label>
        <input name="password" type="password" id="newPassword"  required>
        <span id="error_password" class="error_tip"> </span><br>
        <label for="verificationCode">邮箱验证码：</label>

        <input name="email_code" type="text" id="verificationCode" required><br>
        <span id="error_email_code" class="error_tip"> </span><br>
        <div id="send_email_code" class="get-email">获取验证码</div><br>
        <span id="error_send_email" class="error_tip"> </span><br>
        <button type="submit">确认</button>
        {% if errmsg_email %}
        <span id="" class="error_tip">{{ errmsg_email }}</span><br>
        {% endif %}
    </form>
</div>
<script src="{% static 'js/jquery-3.7.0.min.js' %}"></script>
<script src="{% static 'js/axios-0.18.0.min.js' %}"></script>
<script src="{% static 'js/reset_password.js' %}"></script>

</body>
</html>
